package com.shengqiang.cloud.oauth2;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * Created by Administrator on 2017/11/26.
 */
@EnableSwagger2
@Configuration
public class Swagger2 {

    @Bean
    public Docket createUpmsApi(){
        return new Docket(DocumentationType.SWAGGER_2).
                apiInfo(createApiInfo()).
                select().
                apis(RequestHandlerSelectors.basePackage("com.shengqiang.cloud.oauth2.controller")).
                paths(PathSelectors.any()).build();
    }

    private ApiInfo createApiInfo(){
        return new ApiInfo("micServiceServer用户权限API",
                "micServiceServer认证中心",
                "1.0.0",
                "https://gitee.com/wusq/micServiceServer",
                "吴盛强",
                "",
                "");
    }
}
